<?php
require_once 'MDB2.php';

/*  */
class db_config {
	
	private $dsn;
	
	private $options;
	
	
	
	public function __construct() {
		$this->dsn = 'mysql://root:@localhost/vodafone_check';
		$this->options = array ('persistent' => true);
	}
	
	
	
	/**
	 * 
	 */
	public function get_db() {
		// establish database connection
		$mdb2 =& MDB2::factory($this->dsn, $this->options);
		$mdb2->setFetchMode(MDB2_FETCHMODE_ASSOC);		
		$mdb2 =& MDB2::singleton($this->dsn, $this->options);
		if (PEAR::isError($mdb2)) {
		    die($mdb2->getMessage());
		}
		return $mdb2;
	}
}
?>
